home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
pbaseiv.zip
/
P4DBS002.TIP
< prev
next >
Wrap
Text File
|
1991-12-16
|
2KB
|
49 lines
Pausing a dBASE program with a counter and a loop is a poor
practice. A pause that's the right length on a 6-MHz AT may
be too short on a 25-MHz 80386 system.
TIMEOUT.PRG [see listing] shows a better way to pause for a
length of time. The program uses two variables: stime (the
system time when the program begins its pause) and etime
(the ending time when the program continues). An IF
statement ensures that the delay will be no longer than
about one minute. TIMEOUT executes a WHILE loop that ends
when the current system time equals the calculated ending
time.
Dan O'Brien
Rolling Hills Estates, California
Editor's note: Use the Alt-F key to copy the listing below
to a DOS file called TIMEOUT.PRG. Start dBASE, and at the
dot prompt type DO TIMEOUT. The program displays a message,
pauses for about six seconds, then displays a second
message. For a longer or shorter pause, change the `6' in
the fourth line to another number less than 60. Of course,
you can also change the messages to suit your needs.
TIMEOUT.PRG works with most dBASE compatibles.
TIMEOUT.PRG: This dBASE III Plus program creates pauses that
are independent of system speed. (Extract with Alt-F)
---- BEGIN LISTING ----
set echo off
set talk off
stime=val(substr(time(),7,2))
etime=stime + 6
if etime > 59
etime=etime - 59
endif
@5,5 say "One moment please..."
do while stime # etime
stime=val(substr(time(),7,2))
enddo
@5,5 say "... Your time is up!"
---- END LISTING ----
Title: Punctual Pauses
Category: DBS
Issue date: Mar 1991
Editor: Tom Swan
Supplementary files: NONE